//
//  UpdateTelSuccessViewController.m
//  HTHappySale
//
//  Created by 创维海通 on 2017/9/27.
//  Copyright © 2017年 zxyywy. All rights reserved.
//

#import "UpdateTelSuccessViewController.h"
#import "MeUserInfoViewController.h"

@interface UpdateTelSuccessViewController ()
{
    NSString *phone;
}
@property (strong, nonatomic) IBOutlet UILabel *telLabel;

@end

@implementation UpdateTelSuccessViewController

- (instancetype)init:(NSString *)telString
{
    if ((self = [super init])) {
        phone = telString;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    NSString *telStr = [NSString stringWithFormat:@"您已将手机号修改为%@",phone];
    NSInteger len = [telStr length];
    NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithString:telStr];
    
    [str addAttribute:NSForegroundColorAttributeName value:HTCFQuickRGBColor(102,102,102) range:NSMakeRange(0, len-11)];
    [str addAttribute:NSForegroundColorAttributeName value:HTCFQuickRGBColor(32,170,255) range:NSMakeRange(len-11, 11)];
    _telLabel.attributedText = str;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self addNavigationLeftView:@"" andType:0];
    [self addNavigationMiddleView:@"修改手机号"];
    [self addNavigationRightView:@"完成"];
}

#pragma mark -Action
- (void)rightTapAction{
    NSArray *controllerArr = [self.navigationController viewControllers];
    for (UIViewController *controller in controllerArr) {
        if ([controller isKindOfClass:[MeUserInfoViewController class]]) {
            [self.navigationController popToViewController:controller animated:YES];
        }
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
